﻿using ServiceStack.Redis;
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace RedisDAL
{
    //reids连接
    public partial class RedisConnection
    {
        protected static RedisClient redisClient = null;
        public RedisConnection()
        {
            string strAppRedisServer = ConfigurationManager.AppSettings["Rediscacheserver"].ToString();
            string[] servers = strAppRedisServer.Split(',');
            //可能连接多台服务器
            foreach (string item in servers)
            {
                string[] hostandpost = item.Split(':');
                string host = hostandpost[0];
                int port = Int32.Parse(hostandpost[1]);
                redisClient = new RedisClient(host, port);         
            }
        }
    }
}
